<?php

namespace app\admin\validate;

use think\Validate;

class Wechat extends Validate
{
    protected $rule = [
        'type' => 'require',
        'app_id' => 'require|max:32',
        'app_secret' => 'max:32',
        'mch_id' => 'require|max:32',
        'mch_key' => 'require|max:32',
    ];

    protected $message = [
        'type.require' => '类型有误',
        'app_id.require' => '请输入 AppID',
        'app_id.max' => 'AppID 不能超过 32 个字符',
        'mch_id.require' => '请输入商户号',
        'mch_id.max' => '商户号不能超过 32 个字符',
        'mch_key.require' => '请输入商户密钥',
        'mch_key.max' => '商户密钥不能超过 32 个字符',
    ];

    protected $scene = [
        'update' => [
            'type',
            'app_id',
            'mch_id',
            'mch_key',
        ],
    ];
}
